package cn.wolfcode.luowowo.search.query;

import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;

@Setter
@Getter
public class StrategySearchQuery extends QueryObject {

    //国内
    public static final int CONDITION_TYPE_CHINA = 1;
    //国外
    public static final int CONDITION_TYPE_ABROAD = 0;
    //主题
    public static final int CONDITION_TYPE_THEME = 2;

    //排序字段
    private String orderBy = "viewnum";
    //类型
    private Integer type = -1;
    //类型值
    private Long  typeValue = -1L;



    public PageRequest getPageRequest() {
        return PageRequest.of(super.getCurrentPage() - 1, super.getPageSize(), Sort.Direction.DESC, orderBy);
    }


}
